package Game.Spawners;

import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.List;

import org.newdawn.slick.SlickException;

import Game.GameHelper;
import Game.Level;
import Game.Objects.GameObject;
import GameMath.GPoint;
import Screens.MyScreens.GameScreen;

/** Spawn Mobs class
 * @author Aikidos
 */
public class SpawnMobs extends SpawnerBase {

	@Override
	public void spawn(Level level) throws SlickException, InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException, ClassNotFoundException {
		// Spawn some mobs
		int numOfMobs = 16;
		for (int i = 0; i < numOfMobs; i++) {
			List<GPoint> banCoords = new ArrayList<GPoint>();
			banCoords.add(level.getObjectManager().getPlayer().getCoord());
			
			GameObject mob = level.getObjectManager().getObjectCreator()
					.createCreature(((GameScreen) level.getScreen()).getFloor(), true, level.isUndergroundTown());
			
			level.getObjectManager().spawnObject(mob, banCoords);
		}
	}

}
